package com.dynalog.controller;

import ch.qos.logback.classic.Logger;
import com.dynalog.component.LoggerBuilderUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @author iszengziqiang@163.com
 * @date 2021-11-10 14:48
 * @Version: 1.0
 * @desc
 */
//https://blog.csdn.net/qq_32917699/article/details/105273734
@RestController
public class IndexController {


    @GetMapping("/time")
    public String getTime(String id) {
        Logger logger = LoggerBuilderUtils.getLogger("time");
        logger.info("####id:" + id + "####Time:" + LocalDateTime.now().toString());
        return "####id:" + id + "####Time:" + LocalDateTime.now().toString();
    }

    @GetMapping("/index")
    public String getIndex(String ids) {
        Logger logger = LoggerBuilderUtils.getLogger("index");
        logger.info("####ids:" + ids + "####Time:" + LocalDateTime.now().toString());
        return "####ids:" + ids + "####Time:" + LocalDateTime.now().toString();
    }

}
